/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.puzzud.engine.core;

import java.awt.Point;

/**
 *
 * @author puzzud
 */
public class Item2DMoveable extends Item2D
{
    protected Point velocity;
    protected Timer timer;

    public Item2DMoveable()
    {
        super();

        velocity = new Point( 0, 0 );
        timer = new Timer();
    }

    public Point getVelocity()
    {
        return( velocity );
    }

    public int getXVelocity()
    {
        return( velocity.x );
    }

    public int getYVelocity()
    {
        return( velocity.y );
    }

    public void setVelocity( Point velocity )
    {
        this.velocity = velocity;
    }

    public void setVelocity( int xVelocity, int yVelocity )
    {
        velocity.x = xVelocity;
        velocity.y = yVelocity;
    }

    public void setXVelocity( int xVelocity )
    {
        velocity.x = xVelocity;
    }

    public void setYVelocity( int yVelocity )
    {
        velocity.y = yVelocity;
    }

    public void move()
    {
        //if( timer.run() == true )
        {
            this.position.x += velocity.x;
            this.position.y += velocity.y;
        }
    }

    public void setMoveTimer( int value )
    {
        timer.set( value );
    }
}
